﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LTJ.Common;
using LTJ.Entity;
using LTJ.Data;
using LTJ.FrameWork;

namespace uswinweb.admin
{
    public partial class basedata_update : AdminPage
    {
        public string bcode = SASRequest.GetString("typeid");
        public BaseTypeInfo btInfo = new BaseTypeInfo();
        public int bid = SASRequest.GetInt("bid", 0);
        public BaseDataInfo bInfo = new BaseDataInfo();
        protected void Page_Load(object sender, EventArgs e)
        {
            btInfo = BaseTypes.GetBaseTypeCode(bcode);
            bInfo = BaseDatas.GetBaseDataByID(bid);
            if (SASRequest.IsPost())
            {
                UpdataBaseData();
            }
        }
        protected void UpdataBaseData()
        {

            string tcode = SASRequest.GetFormString("bTcodetxt");
            string name = SASRequest.GetFormString("bnametxt");
            string ename = SASRequest.GetFormString("bEnametxt");
            string expo1 = SASRequest.GetFormString("port_check");
            string expo2 = SASRequest.GetFormString("routes_hidd_luffy");
            string expo3 = SASRequest.GetFormString("national_hidd_luffy");
            bInfo.code = bcode;
            bInfo.tcode = tcode;
            bInfo.name = name;
            bInfo.ename = ename;
            bInfo.expand1 = expo1;
            bInfo.expand2 = expo2;
            bInfo.expand3 = expo3;

            BaseDatas.UpdateBaseData(bInfo);
            base.RegisterStartupScript("PAGE", "parent.document.getElementById('reclick').click();parent.Lightview.hide();");
        }
    }
}